package com.woniuxy.sddfp.system.controller;

import com.woniuxy.sddfp.common.exception.BusinessException;
import com.woniuxy.sddfp.common.result.Result;
import com.woniuxy.sddfp.common.result.enums.impl.BusinessCode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@RestController
@RequestMapping("/test")
public class TestController {
    @GetMapping("/test/{id}")
    public Result test(@PathVariable Integer id) {
        if (id == 1){
            throw new BusinessException(BusinessCode.Fail);
        }
        return Result.ok("测试结果正确");
    }
}
